package com.compass.mobile.models

/**
 * Description：   健康档案   统计图数据
 * Date:2024/7/2 14:17
 */


data class HealthDataWarp(
    val weekList: MutableList<HealthBean>,
    val totalAvg: HealthBean?,//整体平均
    val physicalFitnessTest: PhysicalFitness?,//体重信息
    val monthList: MutableList<HealthBean>,
)

data class PhysicalFitness(
     val height:String,
     val weight:String,
)

data class HealthBean(
    val measurementDate: Long, //测量日期
    val avgLowPressure: String?, //平均低压
    val avgHighPressure: String?, //平均高压
    val hasPressure: String, //当日是否测量血压
    val avgBloodGlucose: String?, //平均血糖
    val hasGlucose: String, //当日是否测量血糖
    val avgUricAcid: String?,//平均尿酸
    val hasAcid: String, //当日是否测量尿酸
) {

    fun getLowPressure(): String {
        avgLowPressure?.let {
            return it
        }
        return "0.0"
    }
    fun getHighPressure(): String {
        avgHighPressure?.let {
            return it
        }
        return "0.0"
    }

    fun getBloodGlucose(): String {
        avgBloodGlucose?.let {
            return it
        }
        return "0.0"
    }

    fun getUricAcid(): String {
        avgUricAcid?.let {
            return it
        }
        return "0.0"
    }
}

/**
 * {
 * "id":"1808018075739136001",
 * "patientId":"1788918640497278978",
 * "measurementDate":1719849600000,
 * "measurementTime":"14:00",
 * "lowPressure":120,
 * "highPressure":90,
 * "bloodGlucose":5.40,
 * "uricAcid":2.00
 * }
 */
data class HealthForDate(
    val id: String, //id
    val patientId: String, //患者id
    val measurementDate: Long, //日期
    val measurementTime: String, //时间
    val lowPressure: String, //低压
    val highPressure: String, //高压
    val bloodGlucose: String,//血糖
    val uricAcid: String, //尿酸
)
